package cn.zs.supply.common.utils;


import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class MyThreadPoolExecutor {

	public static ThreadPoolExecutor getThreadPoolExecutor(){

	    ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 100, 200, TimeUnit.MILLISECONDS,
	            new ArrayBlockingQueue<Runnable>(2),Executors.defaultThreadFactory());
	    executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
	    return  executor;
	}

}
